﻿using System;
using System.IO;
using System.Collections;
using System.Data;
using System.Xml;
using System.Configuration;
using System.Threading;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public class DVersion : Page
{
    private void Page_Load(object sender, EventArgs e)
    {
        DetectVersion();                 
    }
    private void DetectVersion()
    {
        string[] machineCfgPathArr = HttpRuntime.MachineConfigurationDirectory.Split('\\');
	    string CLRVersion = machineCfgPathArr[machineCfgPathArr.Length-2];
        if (CLRVersion.IndexOf("v2.0") == -1)
        {
            ErrorMessage("<font color='#ff0000'>失败：系统要求版本为.net framework v2.0，当前版本为 .net framework " + CLRVersion + "</font>");
        }
    }
    private void ErrorMessage(string s)
    {
        Response.Write(s);
        Response.End();
    }

    protected override void OnInit(EventArgs e)
    {
        InitializeComponent();
        base.OnInit(e);
    }

    private void InitializeComponent()
    {
        this.Load += new EventHandler(this.Page_Load);
    }
}
